<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/23
  Time: 17:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <title>书籍展示</title>
    <div class="container">

        <div class="row-clearfix">
            <div class="col-md-12 colum">
                <div class="page-header">
                    <h1>
                        <small>书籍列表</small>
                    </h1>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4 colum">
                    <a class="btn btn-primary"  href="${pageContext.request.contextPath}/login">新增书籍信息</a>
                    <a class="btn btn-primary"   href="${pageContext.request.contextPath}/book/allBook">全部书籍信息</a>
                </div>
<%--                <div class="col-md-4 colum"></div>--%>
                <div class="col-md-4 colum" align="right">
                    <form action="${pageContext.request.contextPath}/book/queryBookByName" method="get" class="form-inline" style="float:right">
                        <input type="submit" value="查询" class="btn btn-primary">
                        <input type="text" name="queryBookName" class="form-control" placeholder="请输入书籍名称">
                    </form>
                </div>

                <div class="col-md-4 colum" align="right">
                    <form action="${pageContext.request.contextPath}/book/queryBookById" method="get" class="form-inline" style="float:right">
                        <input type="submit" value="查询" class="btn btn-primary">
                        <input type="text" name="queryBookId" class="form-control" placeholder="请输入书籍Id">
                    </form>
                </div>

            </div>
        </div>

        <br><br>
        <div class="row clearfix">
            <div class="col-md-12 colum">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>书籍编号</th>
                        <th>书籍名称</th>
                        <th>书籍价格</th>
                        <th>书籍封皮照片信息</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="book" items="${list}">
                        <tr>
                            <td>${book.bookId}</td>
                            <td>${book.bookName}</td>
                            <td>${book.bookPrice}</td>
                            <td>${book.bookFptpmessage}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/book/toUpdate?id=${book.bookId}">修改</a>
                                &nbsp; | &nbsp;
                                <a href="${pageContext.request.contextPath}/book/deleteBookById/${book.bookId}">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</head>
<body>
<h1></h1>
</body>
</html>
